import urllib.request
import urllib.parse

url = 'https://www.baidu.com/s?wd='

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 '
                  'Safari/537.36 Edg/118.0.2088.76'
}

wd = urllib.parse.quote('周杰伦')

req = urllib.request.Request(url=url + wd, headers=headers)

rep = urllib.request.urlopen(req)
print(rep.read().decode('utf-8'))
